import requests


class TokenUtil:
    # 封装一个获取用户令牌的方法
   @classmethod
   def get_token(cls):
       logn_url="http://ihrm2-test.itheima.net/api/sys/login"
       logn_header={"Content-Type": "application/json"}
       logn_body={"mobile": "13800000002","password": "123456"}
       resp=requests.post(url=logn_url,headers=logn_header,json=logn_body)
       token=resp.json().get("data")
       return token
if __name__ == '__main__':
    print(TokenUtil.get_token())